﻿Imports System.Web.UI

Namespace [Shared].MasterPages
    Public Class Anonymous
        Inherits MasterPage

        Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            SignatureHelper.InitializeComponents(SignaturePanel)
        End Sub

    End Class

    Friend Class SignatureHelper

        Friend Shared Sub InitializeComponents(signature As Panel)
            Dim contacts As IList(Of String) = New List(Of String)
            contacts.Add("Mark Ryan V. Alot | .NET Consultant")
            contacts.Add("14 Roses Street Camella Homes, Piñahan, Bacoor, Cavite 4102, Philippines")
            contacts.Add("T: +63464340991 | M: +639175869149")
            contacts.Add("mark.ryan.v.alot@webforgeconsulting.com")

            signature.Attributes.Add("style", "display: none;")
            Dim inputDiv As HtmlGenericControl = Nothing

            For Each contact As String In contacts
                inputDiv = New HtmlGenericControl("div")
                inputDiv.Attributes.Add("class", "input")

                Dim labelDiv As HtmlGenericControl = New HtmlGenericControl("div")
                labelDiv.Attributes.Add("class", "label")
                labelDiv.InnerText = String.Empty

                Dim dataDiv As HtmlGenericControl = New HtmlGenericControl("div")
                dataDiv.Attributes.Add("class", "data")
                dataDiv.InnerText = contact

                inputDiv.Controls.Add(labelDiv)
                inputDiv.Controls.Add(dataDiv)

                signature.Controls.Add(inputDiv)
            Next
        End Sub

    End Class

End Namespace
